/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package basemodule;

import java.util.ArrayList;
import titanisu.basicMathModule1.divisibility39.ExamController;

/**
 *
 * @author LENOVO
 */
public class Page1 extends javax.swing.JFrame {

    ArrayList progInfo = new ArrayList();

    /**
     * Creates new form Page1
     */
    public Page1() {
this.setUndecorated(true);
        initComponents();
        this.setLocationRelativeTo(null);
        
        jTextArea1.setText("Purpose: To practice divisibility rules for 2 , 4 and 8.\n\n\nThis program generates random values that are divisible by 2 or 4 or 8.\n The answer will be greatest of 2 , 4 and 8.\n\nIf the number is divisible by 2 and 4, then the solution will be 4.");
        progInfo.add(0, "Purpose: To practice divisibility rules for 2 , 4 and 8.\n\n\nThis program generates random values that are divisible by 2 or 4 or 8.\n The answer will be greatest of 2 , 4 and 8.\n\nIf the number is divisible by 2 and 4, then the solution will be 4.");
        progInfo.add(1, "Purpose: To practice divisibility rules for 3 and 9.\n\n\nThis program generates random values that are divisible by 3 or 9.\n The answer will be greatest of 3 and 9.\n\nIf the number is divisible by 3 and 9, then the solution will be 9.");
        progInfo.add(2, "Purpose: To practice divisibility rules for 2 , 3 and 6.\n\n\nThis program generates random values that are divisible by 2 or 3 or 6.\n The answer will be greatest of 2 , 3 and 6.\n\nIf the number is divisible by 2,3 and 6, then the solution will be 6.");
        progInfo.add(3, "Purpose: To practice divisibility rules for 5 and 10.\n\n\nThis program generates random values that are divisible by 5 or 10.\n The answer will be greatest of 5 and 10.\n\nIf the number is divisible by 2 and 4, then the solution will be 4.");
        progInfo.add(4, "Purpose: To practice divisibility rules for 2 to 10.\n\n\nThis program generates random values that are divisible by 2,3,4,5,6,8,9, or 10.\n The answer will be greatest of 2,3,4,5,6,8,9 and 10.\n\nIf the number is divisible by 2 and 4, then the solution will be 4.");
        progInfo.add(5, "Purpose: To practice integer addition and subtraction.\n\n\nThis program generates random values that needs to be \neither added or subtracted, depending on operation specified.");
        progInfo.add(6, "Purpose: To practice integer multiplication and division.\n\n\nThis program generates random values that needs to be\n either multiplied or divided, depending on operation specified.");

        ArrayList<String> progTitle = new ArrayList<String>();

        progTitle.add(0, "Divisibility rules for 2 , 4 and 8.");
        progTitle.add(1, "Divisibility rules for 3 and 9.");
        progTitle.add(2, "Divisibility rules for 2 , 3 and 6.");
        progTitle.add(3, "Divisibility rules for 5 and 10.");
        progTitle.add(4, "Divisibility rules for 2 to 10.");
        progTitle.add(5, "Integer addition subtraction(multi digit.");
        progTitle.add(6, "Integer multiplication division(multi digit).");
        
        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(progTitle.toArray()));


    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        rotatingClass1 = new basemodule.RotatingClass();
        jComboBox1 = new javax.swing.JComboBox();
        SelectTest = new javax.swing.JLabel();
        jTextArea1 = new javax.swing.JTextArea();
        startButton = new javax.swing.JLabel();
        bgImage = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        javax.swing.GroupLayout rotatingClass1Layout = new javax.swing.GroupLayout(rotatingClass1);
        rotatingClass1.setLayout(rotatingClass1Layout);
        rotatingClass1Layout.setHorizontalGroup(
            rotatingClass1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 200, Short.MAX_VALUE)
        );
        rotatingClass1Layout.setVerticalGroup(
            rotatingClass1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 200, Short.MAX_VALUE)
        );

        jPanel1.add(rotatingClass1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 310, -1, -1));

        jComboBox1.setBackground(new java.awt.Color(0, 0, 0));
        jComboBox1.setFont(new java.awt.Font("Georgia", 1, 12)); // NOI18N
        jComboBox1.setForeground(new java.awt.Color(255, 255, 255));
        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Divisibility Rules of 2 , 4 and 8.", "Divisibility Rules of 3 and 9.", "Divisibility Rules of 2 , 3 and 6.", "Divisibility Rules of 5 and 10.", "Divisibility Rules of 2 to 10." }));
        jComboBox1.setBorder(null);
        jComboBox1.setOpaque(false);
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });
        jPanel1.add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 170, 300, -1));

        SelectTest.setFont(new java.awt.Font("Georgia", 3, 18)); // NOI18N
        SelectTest.setForeground(new java.awt.Color(255, 255, 255));
        SelectTest.setText("Select Test");
        jPanel1.add(SelectTest, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, 110, 20));

        jTextArea1.setEditable(false);
        jTextArea1.setBackground(new java.awt.Color(51, 51, 51));
        jTextArea1.setColumns(20);
        jTextArea1.setFont(new java.awt.Font("Georgia", 2, 18)); // NOI18N
        jTextArea1.setForeground(new java.awt.Color(255, 255, 255));
        jTextArea1.setRows(5);
        jTextArea1.setText("This program generates random values that are divisible by 2 or\n4 or 8.\nThe answer will be greatest of 2 , 4 and 8.\n\nIf the number is divisible by 2 and 4, then the solution will be 4.");
        jTextArea1.setBorder(null);
        jTextArea1.setDisabledTextColor(new java.awt.Color(255, 255, 255));
        jTextArea1.setOpaque(false);
        jPanel1.add(jTextArea1, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 200, 640, 230));

        startButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/basemodule/StartExamButton.png"))); // NOI18N
        startButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                startButtonMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                startButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                startButtonMouseExited(evt);
            }
        });
        jPanel1.add(startButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 80, 100, 110));

        bgImage.setBackground(new java.awt.Color(102, 0, 102));
        bgImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/titanisu/commonUtil/FirstPage2.jpg"))); // NOI18N
        jPanel1.add(bgImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, 510));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        // TODO add your handling code here:
        jTextArea1.setText((String) progInfo.get(jComboBox1.getSelectedIndex()));
    }//GEN-LAST:event_jComboBox1ActionPerformed
    int execProg = -10;

    public int getProgName() {
        return execProg;
    }

    private void startButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startButtonMouseEntered
        // TODO add your handling code here:

        startButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/basemodule/StartExamButtonOnHover.png"))); // NOI18N

    }//GEN-LAST:event_startButtonMouseEntered

    private void startButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startButtonMouseExited

        startButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/basemodule/StartExamButton.png"))); // NOI18N
        // TODO add your handling code here:
    }//GEN-LAST:event_startButtonMouseExited

    private void startButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startButtonMouseClicked
        execProg = jComboBox1.getSelectedIndex();
        this.setVisible(false);

        // TODO add your handling code here:
    }//GEN-LAST:event_startButtonMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Page1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Page1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Page1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Page1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Page1().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel SelectTest;
    private javax.swing.JLabel bgImage;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextArea jTextArea1;
    private basemodule.RotatingClass rotatingClass1;
    private javax.swing.JLabel startButton;
    // End of variables declaration//GEN-END:variables
}
